<%= form_for(@event) do |f| %>
  <% if @event.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@event.errors.count, "error") %> prohibited this event from being saved:</h2>

      <ul>
      <% @event.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <div class="field">
    <%= f.label :name %><br />
    <%= f.text_field :name %>
  </div>
  <div class="field">
    <%= f.label :location %><br />
    <%= f.text_field :location %>
  </div>
  <div class="field">
    <%= f.label :time %><br />
    <%= f.datetime_select :time, :start_year => Time.now.year, :ampm => true %>
  </div>
  
  <div class="field">
	<%= f.label 'Required Equipment' %><br />
	<% @equipment.each do |e|%>
		<%= check_box_tag 'required_equipment[]', e.id, @req_equipment.include?(e.id)%>
		<%= link_to(e.name, e, :target => '_blank') %><br /> 
	<% end %>
  </div>
  
  <div class="field">
	<%= f.label 'Required Skills' %><br />
	<% @skills.each do |s|%>
		<%= check_box_tag 'required_skills[]', s.id, @req_skills.include?(s.id)%>
		<%= link_to(s.name, s, :target => '_blank') %><br /> 
	<% end %>
  </div>
  
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
